# -*- coding: gb2312 -*-

from StockDailyFactorGeneralFunctions import StockDailyFactorGeneralFunctions



class BuySellAmount:
    def __init__(self):
        self.baseStartDateStr = '2012-01-01'
        self.baseEndDateStr = '2017-05-01'

    def writeBaseBuySellToMongoDB(self, windFactorNameStr, traderTypeStr):
        baseStartDateStr = self.baseStartDateStr
        baseEndDateStr = self.baseEndDateStr

        colNameStr = windFactorNameStr + traderTypeStr
        dbUpdateDateFiledStr = colNameStr + '_update_date'
        dbUpdateDateFieldAliasStr = ' ' + colNameStr + ' '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.writeBaseBuySellDataToMongoDB(baseStartDateStr, baseEndDateStr, windFactorNameStr, colNameStr, dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr, traderTypeStr)

    def updateBaseBuySellToMongoDB(self, windFactorNameStr, traderTypeStr):

        colNameStr = windFactorNameStr + traderTypeStr
        dbUpdateDateFiledStr = colNameStr + '_update_date'
        dbUpdateDateFieldAliasStr = ' ' + colNameStr + ' '

        funcObj = StockDailyFactorGeneralFunctions()

        funcObj.updateBuySellDataToMongoDB(windFactorNameStr, colNameStr, dbUpdateDateFiledStr, dbUpdateDateFieldAliasStr, traderTypeStr)


#obj = BuySellAmount()
#obj.writeBaseBuySellToMongoDB('mfd_buyamt_d', '4')

#obj.updateBaseBuySellToMongoDB('mfd_buyamt_d', '4')

#obj.writeBaseBuySellToMongoDB('mfd_buyamt_d', '1')

#obj.updateBaseBuySellToMongoDB('mfd_buyamt_d', '1')

#obj.writeBaseEvToMongoDB()
#obj.updateEvToMongoDB()



